// 课程管理相关的API
import request from './request';

// 获取课程列表
export function getCourseList(params) {
  return request({
    url: '/course/list',
    method: 'get',
    params
  });
}

// 获取课程详情
export function getCourseDetail(id) {
  return request({
    url: `/course/${id}`,
    method: 'get'
  });
}

// 添加课程
export function addCourse(data) {
  return request({
    url: '/course',
    method: 'post',
    data
  });
}

// 更新课程信息
export function updateCourse(id, data) {
  return request({
    url: `/course/${id}`,
    method: 'put',
    data
  });
}

// 删除课程
export function deleteCourse(id) {
  return request({
    url: `/course/${id}`,
    method: 'delete'
  });
}

// 批量删除课程
export function batchDeleteCourses(ids) {
  return request({
    url: '/course/batch',
    method: 'delete',
    data: { ids }
  });
}

// 获取课程类型列表
export function getCourseTypeList() {
  return request({
    url: '/course-type/list',
    method: 'get'
  });
}

// 获取院系列表
export function getDepartmentList() {
  return request({
    url: '/department/list',
    method: 'get'
  });
}

// 获取教师列表
export function getTeacherList() {
  return request({
    url: '/teacher/simple-list',
    method: 'get'
  });
}